/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ronsicecream.pos.entities;

import com.buanalintas.bynga.entities.MasterUnit;
import com.buanalintas.bynga.entities.MasterUser;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author user
 */
@Entity
@Table(name = "pos_transaction_out_request_material_to_warehouse")
@XmlRootElement
//@NamedQueries({
//    @NamedQuery(name = "PosTransactionOutRequestMaterialToWarehouse.findAll", query = "SELECT p FROM PosTransactionOutRequestMaterialToWarehouse p"),
//    @NamedQuery(name = "PosTransactionOutRequestMaterialToWarehouse.findBySync", query = "SELECT p FROM PosTransactionOutRequestMaterialToWarehouse p WHERE p.sync = :sync"),
//    @NamedQuery(name = "PosTransactionOutRequestMaterialToWarehouse.findByRequestId", query = "SELECT p FROM PosTransactionOutRequestMaterialToWarehouse p WHERE p.requestId = :requestId"),
//    @NamedQuery(name = "PosTransactionOutRequestMaterialToWarehouse.findByRequestNumber", query = "SELECT p FROM PosTransactionOutRequestMaterialToWarehouse p WHERE p.requestNumber = :requestNumber"),
//    @NamedQuery(name = "PosTransactionOutRequestMaterialToWarehouse.findByRequestTotal", query = "SELECT p FROM PosTransactionOutRequestMaterialToWarehouse p WHERE p.requestTotal = :requestTotal"),
//    @NamedQuery(name = "PosTransactionOutRequestMaterialToWarehouse.findByRequestQuantity", query = "SELECT p FROM PosTransactionOutRequestMaterialToWarehouse p WHERE p.requestQuantity = :requestQuantity"),
//    @NamedQuery(name = "PosTransactionOutRequestMaterialToWarehouse.findByRequestDate", query = "SELECT p FROM PosTransactionOutRequestMaterialToWarehouse p WHERE p.requestDate = :requestDate"),
//    @NamedQuery(name = "PosTransactionOutRequestMaterialToWarehouse.findByRequestProgress", query = "SELECT p FROM PosTransactionOutRequestMaterialToWarehouse p WHERE p.requestProgress = :requestProgress"),
//    @NamedQuery(name = "PosTransactionOutRequestMaterialToWarehouse.findByRequestRejectReason", query = "SELECT p FROM PosTransactionOutRequestMaterialToWarehouse p WHERE p.requestRejectReason = :requestRejectReason"),
//    @NamedQuery(name = "PosTransactionOutRequestMaterialToWarehouse.findByRequestTimestamp", query = "SELECT p FROM PosTransactionOutRequestMaterialToWarehouse p WHERE p.requestTimestamp = :requestTimestamp")})
public class PosTransactionOutRequestMaterialToWarehouse implements Serializable {
    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "request_id")
    private Integer requestId;
    @Column(name = "request_number")
    private String requestNumber;
    @Column(name = "request_total")
    private BigDecimal requestTotal;
    @Column(name = "request_quantity")
    private BigDecimal requestQuantity;
    @Column(name = "request_date")
    @Temporal(TemporalType.DATE)
    private Date requestDate;
    @Column(name = "request_progress")
    private String requestProgress;
    @Column(name = "request_reject_reason")
    private String requestRejectReason;
    @Lob
    @Column(name = "request_description")
    private String requestDescription;
    @Column(name = "request_timestamp")
    @Temporal(TemporalType.TIMESTAMP)
    private Date requestTimestamp;
    @JoinColumn(name = "request_user_id", referencedColumnName = "user_id")
    @ManyToOne
    private MasterUser requestUserId;
    @JoinColumn(name = "request_unit_id", referencedColumnName = "unit_id")
    @ManyToOne
    private MasterUnit requestUnitId;
    @JoinColumn(name = "request_pos_unit_id", referencedColumnName = "unit_id")
    @ManyToOne
    private PosMasterUnit requestPosUnitId;
    @JoinColumn(name = "request_destination_unit_id", referencedColumnName = "unit_id")
    @ManyToOne
    private PosMasterUnit requestDestinationUnitId;
    @JoinColumn(name = "request_regional_id", referencedColumnName = "regional_id")
    @ManyToOne
    private PosMasterRegional requestRegionalId;
    
    public PosTransactionOutRequestMaterialToWarehouse() {
    }

    public PosTransactionOutRequestMaterialToWarehouse(Integer requestId) {
        this.requestId = requestId;
    }

    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    public Integer getRequestId() {
        return requestId;
    }

    public void setRequestId(Integer requestId) {
        this.requestId = requestId;
    }

    public String getRequestNumber() {
        return requestNumber;
    }

    public void setRequestNumber(String requestNumber) {
        this.requestNumber = requestNumber;
    }

    public Date getRequestDate() {
        return requestDate;
    }

    public void setRequestDate(Date requestDate) {
        this.requestDate = requestDate;
    }

    public String getRequestProgress() {
        return requestProgress;
    }

    public void setRequestProgress(String requestProgress) {
        this.requestProgress = requestProgress;
    }

    public String getRequestRejectReason() {
        return requestRejectReason;
    }

    public void setRequestRejectReason(String requestRejectReason) {
        this.requestRejectReason = requestRejectReason;
    }

    public String getRequestDescription() {
        return requestDescription;
    }

    public void setRequestDescription(String requestDescription) {
        this.requestDescription = requestDescription;
    }

    public Date getRequestTimestamp() {
        return requestTimestamp;
    }

    public void setRequestTimestamp(Date requestTimestamp) {
        this.requestTimestamp = requestTimestamp;
    }

    public BigDecimal getRequestTotal() {
        return requestTotal;
    }

    public void setRequestTotal(BigDecimal requestTotal) {
        this.requestTotal = requestTotal;
    }

    public BigDecimal getRequestQuantity() {
        return requestQuantity;
    }

    public void setRequestQuantity(BigDecimal requestQuantity) {
        this.requestQuantity = requestQuantity;
    }

    public MasterUser getRequestUserId() {
        return requestUserId;
    }

    public void setRequestUserId(MasterUser requestUserId) {
        this.requestUserId = requestUserId;
    }

    public MasterUnit getRequestUnitId() {
        return requestUnitId;
    }

    public void setRequestUnitId(MasterUnit requestUnitId) {
        this.requestUnitId = requestUnitId;
    }

    public PosMasterUnit getRequestPosUnitId() {
        return requestPosUnitId;
    }

    public void setRequestPosUnitId(PosMasterUnit requestPosUnitId) {
        this.requestPosUnitId = requestPosUnitId;
    }

    public PosMasterUnit getRequestDestinationUnitId() {
        return requestDestinationUnitId;
    }

    public void setRequestDestinationUnitId(PosMasterUnit requestDestinationUnitId) {
        this.requestDestinationUnitId = requestDestinationUnitId;
    }

    public PosMasterRegional getRequestRegionalId() {
        return requestRegionalId;
    }

    public void setRequestRegionalId(PosMasterRegional requestRegionalId) {
        this.requestRegionalId = requestRegionalId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (requestId != null ? requestId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PosTransactionOutRequestMaterialToWarehouse)) {
            return false;
        }
        PosTransactionOutRequestMaterialToWarehouse other = (PosTransactionOutRequestMaterialToWarehouse) object;
        if ((this.requestId == null && other.requestId != null) || (this.requestId != null && !this.requestId.equals(other.requestId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return requestNumber;
//        return "com.ronsicecream.pos.entities.PosTransactionOutRequestMaterialToWarehouse[ requestId=" + requestId + " ]";
    }
    
}
